﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Licenta1.Expressions;

namespace Licenta1.Statements
{
    class IfThenStatement:Statement
    {
        BooleanExpression condition;
        Statement then;

        public IfThenStatement(Context context, Expression cond, Statement expr)
            : base(context)
        {
            condition = (BooleanExpression)cond;
            then = expr;
        }

        public override void Execute()
        {
            if (condition.Value.ToString() == "True")
                then.Execute();
        }
    }
}
